public class Method6 {
    public static void main(String[] args) {
        System.out.println(fun(5));
    }

    public static int fun(int n) {
        int sum = 0;
        int temp = 1;
        for (int i = 1; i <= n; i++) {
            temp *= i;
            sum += temp;
        }
        return sum;
    }
}
